Machine-to-machine communications (Machine-to-Machine Communications, M2M) is a network-based application and service focusing on intelligent machine-to-machine interaction. The M2M technology embeds a wireless or wired communication module and an application processing logic into a machine to implement data communication without manual intervention, so as to satisfy information requirements of a user in various aspects such as monitoring, commanding and scheduling, data collection, and measurement. In an M2M architecture in the prior art, a communication method oriented to a group resource is described. In this method, an M2M application, an M2M platform, an M2M terminal, an M2M gateway, and each application or a first data object running on the M2M terminal and M2M gateway are all regarded as a representational state transfer (REpresentational State Transfer) style of RESTful resources; a universal resource identifier (Universal Resource Identifier, URI) is used to identify an application or a data object; and various group resources are created to perform a group operation for the above multiple resources.
In some common M2M services, a user may create a group to simultaneously perform same operations for member resources such as the M2M terminal or gateway included in the group resource. It is understandable that the created group resource is also a resource, and that the group resource includes resources of the group resource itself and member resources included in the group resource. The resources of the group resource itself may be an identifier of the group resource, a group server that the group resource belongs to, a state (for example, whether it is a stateful group resource), and so on. Further, the member resources included in the group resource may be a list of member resources, and may also be a mapping of member resource related information in the group resource. The member resources in the M2M group resource may belong to a local group server, or may also belong to a remote group server. However, in some cases, either of two group resources may be a member resource of the other group resource. For example, in an intelligent safe-guard system, a regional police station can set monitoring groups in neighboring communities to be mutually inclusive, and when an alarm occurs, mutual aid may be provided according to the actual condition. For another example, in a future smart home system, a user may perform group management for electrical appliances (such as a lamp, a door and a window, and metering) at home or on behalf of another family member. Consider a specific example when children consider that parents are old; and therefore, a group of electrical appliances at the home of the parents may be nested to help the parents to perform management. In such case, for example, the system may help to close the windows when it rains, confirm closure of doors and windows at night, and turn off all electrical appliances. Similarly, in an instance where the parents consider that the children are busy on work and always on business trips, and a group of electrical appliances at the home of the children may also be nested to help the children to take care of the family. In another case, a same member resource may be included by two group resources.
In the above cases, when group resources are mutually inclusive, an error indicating that an operation request sent to a group resource is sent cyclically between the mutually inclusive group resources may be caused, and when a same member resource is included by at least two group resources, an error indicating that an operation request directed to the at least two group resources is executed repeatedly may be caused.